package com.njxzc.igo.controller.order;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.njxzc.igo.model.Order;
import com.njxzc.igo.service.OrderService;
import com.njxzc.igo.service.OrderServiceImpl;


@WebServlet(name="orderDetail",urlPatterns="/orderinfo.do")
public class LoadOrderDetailsController extends HttpServlet{
	private OrderService os = new OrderServiceImpl();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String orderId = request.getParameter("orderId");
		Order order = os.loadOrderDetails(orderId);
		request.setAttribute("order", order);
		request.getRequestDispatcher("/WEB-INF/orderinfo.jsp").forward(request, response);
	}
}
